package com.xingdata.jjxc.utils;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import com.xingdata.jjxc.R;
import com.xingdata.jjxc.views.Widget;

public class ActivityTools {
	private static ArrayList<Activity> activities = null;

	public ArrayList<Activity> getActivities() {
		return activities;
	}

	public static void addActivities(Activity activity) {
		if (activities == null) {
			activities = new ArrayList<Activity>();
		}
		activities.add(activity);
	}
	
	
	

	public static void finish() {
		for (Activity activity : activities) {
			if (!activity.isFinishing()) {
				activity.finish();
			}
		}
	}

	public static void startActivity(Context context, Intent intent) {
		((Activity) context).startActivity(intent);
		Widget.startActivityAnim((Activity) context,
				R.anim.avty_slide_in_from_right,
				R.anim.avty_slide_out_from_left);
	};
	

}
